<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">

<head>
  <!-- Required meta tags -->
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
  <title>Purple Admin</title>
  <!-- plugins:css -->
  <link rel="stylesheet" href="vendors/iconfonts/mdi/css/materialdesignicons.min.css"/>
  <link rel="stylesheet" href="vendors/css/vendor.bundle.base.css"/>

  <!-- endinject -->
  <!-- plugin css for this page -->

  <!-- End plugin css for this page -->
  <!-- inject:css -->
  <link rel="stylesheet" href="css/style.css"/>
  <!-- endinject -->
  <link rel="shortcut icon" href="images/favicon.png" />

</head>

<body>
<div class="row">
  <div class="col-lg-12 stretch-card">
    <div class="card">
      <div class="card-body">
        <h4 class="card-title">首页/设置/消息提醒</h4>
        <p class="card-description">
            消息提醒
        </p>
        <table class="table table-bordered">
          <thead>
          <tr>
            <th>消息类型</th>
            <th>电子邮件</th>
            <th>手机短信</th>
          </tr>
          </thead>
          <tbody>
            <tr>
                <td>贷款审批通过提醒</td>
                <td><input name="01checkbox1" type="checkbox" value="1" checked="checked" />是否发送</td>
                <td><input name="01checkbox2" type="checkbox" value="1" checked="checked" />是否发送</td>
            </tr>
          </tbody>
        <tbody>
        <tr>
            <td>贷款审批拒绝提醒</td>
            <td><input name="02checkbox1" type="checkbox" value="0" checked="checked" />是否发送</td>
            <td><input name="02checkbox2" type="checkbox" value="1" checked="checked" />是否发送</td>
        </tr>
      </tbody>
            <tbody>
            <tr>
                <td>放款提醒</td>
                <td><input name="03checkbox1" type="checkbox" value="1" checked="checked" />是否发送</td>
                <td><input name="03checkbox2" type="checkbox" value="1" checked="checked" />是否发送</td>
            </tr>
            </tbody>
            <tbody>
            <tr>
                <td>预警提醒</td>
                <td><input name="04checkbox1" type="checkbox" value="1" checked="checked" />是否发送</td>
                <td><input name="04checkbox2" type="checkbox" value="1" checked="checked" />是否发送</td>
            </tr>
            </tbody>
            <tbody>
            <tr>
                <td>即将到期提醒</td>
                <td><input name="05checkbox1" type="checkbox" value="1" checked="checked" />是否发送</td>
                <td><input name="05checkbox2" type="checkbox" value="1" checked="checked" />是否发送</td>
            </tr>
            </tbody>
            <tbody>
            <tr>
                <td>逾期提醒</td>
                <td><input name="06checkbox1" type="checkbox" value="1" checked="checked" />是否发送</td>
                <td><input name="06checkbox2" type="checkbox" value="1" checked="checked" />是否发送</td>
            </tr>
            </tbody>
            <tbody>
            <tr>
                <td>还款提醒</td>
                <td><input name="07checkbox1" type="checkbox" value="1" checked="checked" />是否发送</td>
                <td><input name="07checkbox2" type="checkbox" value="1" checked="checked" />是否发送</td>
            </tr>
            </tbody>
            <tbody>
            <tr>
                <td>结项提醒</td>
                <td><input name="08checkbox1" type="checkbox" value="1" checked="checked"/>是否发送</td>
                <td><input name="08checkbox2" type="checkbox" value="1" checked="checked" />是否发送</td>
            </tr>
            </tbody>
        </table>
          <input id="num" type="number" value="" placeholder="选择消息提醒类型（1-8）"/>
          <input id="email" type="text" value=""  placeholder="请输入邮箱"/>
          <input id="sms" type="text" value=""  placeholder="请输入电话号码"/>
          <button type="button" class="btn btn-gradient-primary btn-fw" onclick="on()">发送信息</button>
      </div>
    </div>
  </div>
</div>

  <!-- container-scroller -->
  <!-- plugins:js -->

  <script src="vendors/js/vendor.bundle.base.js"></script>
  <script src="js/jquery-3.2.1.min.js"></script>
  <script type="text/javascript">
      function on() {
          var id = $("#num").val();
          var email = $("#email").val();
          var num = $("#sms").val();

         if(email == ""){
             alert(id+">>>>>>>"+num);
             $.ajax({
                 url: "/hxvip/sms",
                 type: "get",
                 data: {"id": id, "num": num},
                 dataType: "json",
                 success: function (result) {
                     if (result.isSuccess) {
                         alert("消息已发送，请注意查收！");
                     }else{
                         alert("发送失败！");
                     }
                 },
                 error: function () {
                     alert("异常！");
                 }
             })
         }else if(num == ""){
             alert(id+">>>>>>>"+email);
             $.ajax({
                 url: "/hxvip/email",
                 type: "get",
                 data: {"id": id, "email": email},
                 dataType: "json",
                 success: function (result) {
                     if (result.isSuccess) {
                         alert("消息已发送，请注意查收！");
                     }else{
                         alert("发送失败！");
                     }
                 },
                 error: function () {
                     alert("异常！");
                 }
             })
         }else {
             alert(id+">>>>>>>"+email+">>>>>>>>"+num);
             $.ajax({
                 url: "/hxvip/sendAll",
                 type: "get",
                 data: {"id": id, "email": email,"num":num},
                 dataType: "json",
                 success: function (result) {
                     if (result.isSuccess) {
                         alert("消息已发送，请注意查收！");
                     }else{
                         alert("发送失败！");
                     }
                 },
                 error: function () {
                     alert("异常！");
                 }
             })
         }
      }



  </script>
<!-- plugins:js -->
<script src="vendors/js/vendor.bundle.base.js"></script>
<script src="vendors/js/vendor.bundle.addons.js"></script>
<!-- endinject -->
<!-- Custom js for this page-->
<script src="js/dashboard.js"></script>
<!-- End custom js for this page-->
  <script type="text/javascript">

  </script>
  <script src="vendors/js/vendor.bundle.addons.js"></script>
  <!-- endinject -->
  <!-- Plugin js for this page-->
  <!-- End plugin js for this page-->
  <!-- inject:js -->
  <script src="js/off-canvas.js"></script>
  <script src="js/misc.js"></script>
  <!-- endinject -->
  <!-- Custom js for this page-->
  <!-- End custom js for this page-->
</body>

</html>
